<?php
  if(stristr($buffer,chr(1)."ACTION feeds ")){
    if(stristr($buffer,$nickname)){
      $eatIA=explode("PRIVMSG $channel :",$buffer);
      $eatItem=str_replace(chr(1)."ACTION feeds","",$eatIA[1]);
      $eatItem=str_replace(chr(1),"",$eatItem);
      $eatItem=str_ireplace("to ".$nickname,"",$eatItem);
      $eatItem=str_ireplace($nickname,"",$eatItem);
      $eatItem=str_ireplace(" a "," the ",$eatItem);
      $eatItem=trim($eatItem);
      $eatResponses=Array(
                    "ACTION eats $eatItem",
                    "ACTION eats it",
                    "ACTION eats $eatItem, just to barf it up on $sender's shoe",
                    "EWWW!!!!!! IT'S OLD!!!!!",
                    "ACTION barfs $eatItem up on the floor at $sender's feet",
                    "ACTION refuses to eat $eatItem, and puts it down the garbage disposal instead",
                    "ACTION doesn't think that'll taste good and gives it to Xando... XANDO WONT EAT IT?! OH NOES"
                    );
      $randInt=rand(0,sizeOf($eatResponses)-1);
      $eatResponse=$eatResponses[$randInt];
      while(stristr($eatResponse,"  ")){
				$eatResponse=str_replace("  "," ",$eatResponse);
      }
      if(!empty($eatItem)){
        if(substr(strtolower($eatItem),0,3)=="to "){
					$eatItem=str_replace("to ","",$eatItem);
          SendCommand("PRIVMSG $channel :".chr(1)."ACTION eats $eatItem first".chr(1));
        } else {
          if(substr($eatResponse,0,7)=="ACTION "){
            SendCommand("PRIVMSG $channel :".chr(1).$eatResponse.chr(1));
          } else {
            SendCommand("PRIVMSG $channel :".$eatResponse);
          }
        }
      }
    }
  }
?>